﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shop.Core.Domain.Payments;

namespace Shop.Core.Domain.Orders
{
    class FlowNodeFactory
    {
        static IDictionary<OrderStatus, IOrderFlowNode> FolwNodes = new Dictionary<OrderStatus, IOrderFlowNode>();
        static FlowNodeFactory()
        {
            FolwNodes[OrderStatus.Authorized] = new AuthorizedNode();
            FolwNodes[OrderStatus.BackOrder] = new BackOrderNode();
            FolwNodes[OrderStatus.Cancelled] = new CancelledNode();
            FolwNodes[OrderStatus.Completed] = new CompletedNode();
            FolwNodes[OrderStatus.CustomerEditting] = new CustomerEdittingNode();
            FolwNodes[OrderStatus.EmployeeEditting] = new EmployeeEdittingNode();
            FolwNodes[OrderStatus.PartiallyPaid] = new PartiallyPaidNode();
            FolwNodes[OrderStatus.PartiallyShipped] = new PartiallyShippedNode();
            FolwNodes[OrderStatus.PaymentComfired] = new PaymentComfiredNode();
            FolwNodes[OrderStatus.PaymentPending] = new PaymentPendingNode();
            FolwNodes[OrderStatus.PaymentReceipted] = new PaymentReceiptedNode();
            FolwNodes[OrderStatus.Shipped] = new ShippedNode();
            FolwNodes[OrderStatus.ShipPending] = new ShipPendingNode();
        }
        public static IOrderFlowNode GetFlowNode(OrderStatus statusCode)
        {
            return FolwNodes[statusCode];
        }
    }
}
